Two types of electronic simulation are circuit simulation and device simulation. A circuit simulator simulates the working of a circuit made up of devices. A device simulator simulates the workings of a device by emulating the elements of the device. A device simulator is used to design a new device while a circuit simulator is used to design a complete circuit.
Due to the nature of circuits and devices, different approaches to simulation have been designed.
A popular analog circuit simulator, created at the University of California at Berkeley, is SPICE. SPICE is a general-purpose circuit simulator with several built-in semiconductor device models. SPICE does analog simulation based on matrix solution techniques. The University of Georgia Tech extended this work by adding event-driven simulation and called the result XSPICE. XSPICE includes both analog and event-driven simulation. XSPICE is capable of simulating analog devices and a specific list of digital devices and devices modeled in programs referred to as a xe2x80x9ccode modelsxe2x80x9d.
Most complex digital devices are separately designed using an event-driven simulator, such as an HDL (Hardware Description Language). Examples include VHDL or Verilog. (Verilog-XL is a registered trademarks of Cadence Design Systems, Inc.)
It is desirable to simulate a digital device, written for an event-driven simulator, in a mixed-mode (analog/digital) circuit. It is also desirable to permit debugging of both the circuit and the digital device at the same time (i.e. debugging the internals of a device designed in an HDL, while debugging the circuit that uses the HDL defined device).
Such mixed-mode simulation is useful, for example, when designing the circuits in cellular telephones. The circuit portions which receive and transmit sound and radio frequencies are analog. Conventionally, they are simulated using SPICE. Linking these analog portions, typically, is a digital chip (or chips) to control, encrypt, decrypt, encode and decode. Digital chips are often described in a high level design language (xe2x80x9cHDLxe2x80x9d) and simulated separately. It is desirable to simulate the entire system, both analog and digital portions, together.
One technique is to xe2x80x9cconnectxe2x80x9d simulators (i.e. use XSPICE to do the analog and basic digital devices and another simulator to do VHDL with yet another for Verilog). As other device simulation technologies are added, other simulators are connected.
A key technical problem is the incompatibility of the basic principals of each simulator. One example of this incompatibility is time.
1. Digital device event-driven simulators only move forward in time as the outcome for the next step is always predictable. Continuous function circuit simulators, such as SPICE, on the other hand xe2x80x9ctryxe2x80x9d a future value and if that doesn""t work, back up in time and try another value.
2. Digital device simulators tend to work in larger, more uniform units of time than analog circuit simulators.
The requirement to simulate and debug a circuit and a chip at the same time requires that the simulators stay in sync and the user interfaces are driven by this synchronized time.
One solution is that of Viewlogic Systems in a product called xe2x80x9cFusionxe2x80x9d(trademark). This approach to coordinating time and communications across simulators is to build a supervisor. All simulators are controlled by the FUSION control program. It sets all timings and coordinates all data. This approach forces all of the simulators to be modified to work in this environment as all simulators must derive their timing information from the supervisor.
An alternate solution is desirable.
In a first aspect, the invention provides a mixed-mode simulator for simulating a circuit containing an event-driven device with a plurality of pins. The mixed-mode simulator has a circuit simulator for simulating at least an analog portion of the circuit. The circuit simulator has a user-defined device modeling feature. The mixed-mode simulator has an event-driven device simulator and an interface between the circuit simulator and the event-driven device simulator. The interface has a parameter passing portion for receiving values from and returning values to the circuit simulator through the user-defined device modeling feature. The interface also has a timing portion for instructing the event-driven simulator to run a simulation of the device based on the values for a given period of time. The interface further has a response reading portion for reading the values of the pins at the end of the period of time. The values are returned to the circuit simulator through the parameter passing portion and the user-defined modeling feature.
The circuit simulator may be a SPICE-type simulator. It may also be a XSPICE-type simulator. The event-driven device simulator may be an HDL simulator.
Upon first call of the interface by the circuit simulator for any one circuit to be simulated, the interface may acquire the definition of the pins of the device from the event-driven simulator.
The mixed-mode simulator may have a plurality of event-driven device simulators, and a corresponding interface for each event-driven device simulator.
In a second aspect the invention provides, a mixed-mode simulator has circuit simulator software for simulating at least an analog portion of the circuit. The circuit simulator software has a user-defined device modeling feature. The mixed-mode simulator also has event-driven device simulator software, and interface software. The circuit simulator software, the event-driven device simulator software, and the interface software run on computer processing means, including storage media and operating system software. The interface software has a parameter passing portion for receiving values from and returning values to the circuit simulator software through the user-defined device modeling feature. The interface software has a timing portion for instructing the event-driven simulator software to run a simulation of the device based on the values for a given period of time. The interface software further has a response reading portion for reading the values of the pins at the end of the period of time. The values are returned to the circuit simulator software through the parameter passing portion and the user-defined modeling feature.
In a third aspect the invention provides the interface of the first aspect, while on a fourth aspect, the invention provides the interface software and accompanying storage media of the second aspect.